{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Identifying Right AD Banner Using MAB"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "\n",
    "Let us say you are running a website and you have five different banners for the same ad and you want to know which banner attracts the user? We model this problem statement as a bandit problem. Let us say these five banners are five bandits and we assign reward 1 if the user clicks the ad and reward 0 if the user does not click the ad.\n",
    "\n",
    "In a normal A/B testing, we perform complete exploration of all these five banners alone before deciding which banner is the best. But that will cost us lot of regret. Instead, we will use good exploration strategy for deciding which banner will give us most rewards (most clicks)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    " First, let us import necessary libraries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[2018-06-01 12:43:31,568] Making new env: BanditTenArmedGaussian-v0\n"
     ]
    }
   ],
   "source": [
    "import gym_bandits\n",
    "import gym\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "import seaborn as sns\n",
    "env = gym.make(\"BanditTenArmedGaussian-v0\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true,
    "scrolled": true
   },
   "source": [
    "Let us simulate a dataset with 5*10000 as shape where the column is the ad banner type and rows are either 0 or 1 i.e whether the ad has been clicked or not clicked by the user respectively\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df = pd.DataFrame()\n",
    "df['Banner_type_0'] = np.random.randint(0,2,100000)\n",
    "df['Banner_type_1'] = np.random.randint(0,2,100000)\n",
    "df['Banner_type_2'] = np.random.randint(0,2,100000)\n",
    "df['Banner_type_3'] = np.random.randint(0,2,100000)\n",
    "df['Banner_type_4'] = np.random.randint(0,2,100000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Banner_type_0</th>\n",
       "      <th>Banner_type_1</th>\n",
       "      <th>Banner_type_2</th>\n",
       "      <th>Banner_type_3</th>\n",
       "      <th>Banner_type_4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Banner_type_0  Banner_type_1  Banner_type_2  Banner_type_3  Banner_type_4\n",
       "0              0              0              0              0              0\n",
       "1              0              1              0              1              1\n",
       "2              1              0              0              1              1\n",
       "3              1              1              1              1              0\n",
       "4              0              1              1              0              1\n",
       "5              1              0              1              0              1\n",
       "6              0              0              0              1              0\n",
       "7              0              1              1              1              0\n",
       "8              0              1              1              0              1\n",
       "9              0              1              1              1              1"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "First, let us initialize necessary variables"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# number of banners\n",
    "num_banner = 5\n",
    "\n",
    "# number of iterations\n",
    "no_of_iterations = 100000\n",
    "\n",
    "# list for storing banners which are selected\n",
    "banner_selected = []\n",
    "\n",
    "# count number of times the banner was selected\n",
    "count = np.zeros(num_banner)\n",
    "\n",
    "# Q value of the banner\n",
    "Q = np.zeros(num_banner)\n",
    "\n",
    "# sum of rewards obtained by the banner\n",
    "sum_rewards = np.zeros(num_banner)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " Now we define the epsilon greedy policy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def epsilon_greedy(epsilon):\n",
    "    \n",
    "    random_value = np.random.random()\n",
    "    choose_random = random_value < epsilon\n",
    "    \n",
    "    if choose_random:\n",
    "        action =  np.random.choice(num_banner)\n",
    "    else:\n",
    "        action = np.argmax(Q)\n",
    "    \n",
    "    return action\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "for i in range(no_of_iterations):\n",
    "    \n",
    "    # select the banner using epsilon greedy policy\n",
    "    banner = epsilon_greedy(0.5)\n",
    "        \n",
    "    # get the reward\n",
    "    reward = df.values[i, banner]\n",
    "    \n",
    "    # update the selected banner count\n",
    "    count[banner] += 1\n",
    "    \n",
    "    # sum the rewards obtained by that banner\n",
    "    sum_rewards[banner]+=reward\n",
    "    \n",
    "    # calculate the Q value of the banner\n",
    "    Q[banner] = sum_rewards[banner]/count[banner]\n",
    "    \n",
    "    banner_selected.append(banner)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can plot and see which banner type gives us most clicks(rewards)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x7fbfc8220ac8>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW4AAAD8CAYAAABXe05zAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nA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+BsVFLREZDuB6AKs8XYsRBnNwxwIo/NLPRRjgb2RqJyIJAFIB7PVs\nJcbr6C7IBlABYKtSasCfc4fnADwBwOHpQowwmIO7qwURBkVrZDATkSAA7wJ4RCmlxz3KLoBSyq6U\nmoz2Gc/TRGSCp2symojcAKBCKZXp6VqMMpiD26mp/DRwiIgZ7aH9plLqPU/X405KqVoA2zA4rm/M\nADBfRE6jvQt0joi84dmSXGswBzen8g8i0r7k3MsAcpVSz3q6HncQEYuIhHV87w9gLoA8z1ZlPKXU\nk0qp4UqpBLS/r/+ulLrLw2W51KANbqWUDUDnVP5cAG8Phqn8IrIOwG4AySJSJCLf83RNbjIDwN1o\nb31ld3xd5+miDBYN4AsROYT2hspWpdSAGxo3GHHmJBGRZgZti5uISFcMbiIizTC4iYg0w+AmItIM\ng5uISDMMbiIizTC4iYg0w+AmItLM/wGmEzTYoDQp5AAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fbfc8237668>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.distplot(banner_selected)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:universe]",
   "language": "python",
   "name": "conda-env-universe-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
